home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / init.d / cron < prev    next >
Encoding:
Text File  |  2006-12-20  |  1.7 KB  |  47 lines

  1. #!/bin/sh
  2. # Start/stop the cron daemon.
  3. #
  4. ### BEGIN INIT INFO
  5. # Provides:          cron
  6. # Required-Start:    $syslog $time
  7. # Required-Stop:     $syslog $time
  8. # Default-Start:     2 3 4 5
  9. # Default-Stop:      0 1 6
  10. # Short-Description: Regular background program processing daemon
  11. # Description:       cron is a standard UNIX program that runs user-specified 
  12. #                    programs at periodic scheduled times. vixie cron adds a 
  13. #                    number of features to the basic UNIX cron, including better
  14. #                    security and more powerful configuration options.
  15. ### END INIT INFO
  16.  
  17.  
  18. test -f /usr/sbin/cron || exit 0
  19.  
  20. #LSBNAMES='-l'  # Uncomment for LSB name support in /etc/cron.d/
  21.  
  22. . /lib/lsb/init-functions
  23.  
  24. case "$1" in
  25. start)    log_daemon_msg "Starting periodic command scheduler" "crond"
  26.         start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
  27.         log_end_msg $?
  28.     ;;
  29. stop)    log_daemon_msg "Stopping periodic command scheduler" "crond"
  30.         start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid --name cron
  31.         log_end_msg $?
  32.         ;;
  33. restart) log_daemon_msg "Restarting periodic command scheduler" "crond" 
  34.         start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/crond.pid --name cron
  35.         start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
  36.         log_end_msg $?
  37.         ;;
  38. reload|force-reload) log_daemon_msg "Reloading configuration files for periodic command scheduler" "crond"
  39.     # cron reloads automatically
  40.         log_end_msg 0
  41.         ;;
  42. *)    log_action_msg "Usage: /etc/init.d/cron {start|stop|restart|reload|force-reload}"
  43.         exit 2
  44.         ;;
  45. esac
  46. exit 0
  47.